Deleting source `reef_combined.geojson' using driver `GeoJSON'
Writing layer `reef_combined' to data source
`reef_combined.geojson' using driver `GeoJSON'
options: RFC7946=YES WRITE_BBOX=YES
Writing 21 features with 3 fields and geometry type Multi Polygon.
Code
# 2) ESRI Shapefile (generates .shp/.shx/.dbf/.prj)# Note: Shapefile has 10-char field name limit; 'reef_name' is fine (9 chars)sf::st_write( reef_export,dsn ="reef_combined.shp",driver ="ESRI Shapefile",delete_dsn =TRUE,layer_options =c("ENCODING=UTF-8"))
Deleting source `reef_combined.shp' using driver `ESRI Shapefile'
Writing layer `reef_combined' to data source
`reef_combined.shp' using driver `ESRI Shapefile'
options: ENCODING=UTF-8
Writing 21 features with 3 fields and geometry type Multi Polygon.
Code
# (Optional) Zip the shapefile components for sharingshp_files <-list.files(pattern ="^reef_combined\\.(shp|shx|dbf|prj|cpg)$",ignore.case =TRUE, full.names =TRUE)utils::zip("reef_combined_shapefile.zip", shp_files)